package com.dict.modules.utils;

import jakarta.validation.Validation;
import jakarta.validation.ValidatorFactory;
import org.hibernate.validator.HibernateValidator;

/**
 * ValidatorFactory
 */
public class ValidatorFactoryUtil {


    //初始化一个校验器工厂
    public static final ValidatorFactory VALIDATOR_FACTORY = Validation.byProvider(HibernateValidator.class).configure()
            //校验失败是否立即返回： true-遇到一个错误立即返回不在往下校验，false-校验完所有字段才返回
            .failFast(false).buildValidatorFactory();
}
